<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class QuotationSheet extends Model
{
    public function getContentAttribute($value)
    {
        return (empty($value)) ? array() : explode(',', $value);
    }

    public function setContentAttribute($value)
    {
        $this->attributes['content'] = implode(',', $value);
    }

    public $timestamps = false;
    /**
     * 获取查询字段
     *
     * @var array
     */
    protected $fillable = [
        'id', 'title', 'content', 'desc', 'is_show', 'create_at', 'background_image'
    ];

    // 表示 create_time 是一个日期字段
    protected $dates = [];

    /**
     * 隐藏字段
     *
     * @var array
     */
    protected $hidden = [];
}
